package cn.ffcs.ref.dao;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

import cn.ffcs.base.dao.BaseDAO;
import cn.ffcs.ref.model.ProductRefSort;

/**
 * 
 * 字典类型DAO实现<br/> <table>
 * <tr>
 * <td>负责人/principal: </td>
 * <td colspan="2">liuzhh</td>
 * <tr>
 * <td>修改记录/revision:</td>
 * <td colspan="2"></td>
 * </tr>
 * <tr>
 * <td>日期:</td>
 * <td>修改人:</td>
 * <td>修改说明:</td>
 * </tr>
 * <tr>
 * <td></td>
 * <td></td>
 * <td></td>
 * </tr>
 * </table>
 * @author liuzhh
 * @version $Id$
 */
public class ProductRefSortDAO<D extends ProductRefSort> extends BaseDAO<D> implements IProductRefSortDAO<D>
{
    /**
     * 获取字典类型实体类
     * @param b
     * @return
     */
    public String getEntityName()
    {
        return new ProductRefSort().getClass().getName();
    }
    /**
     * 根据类型删除产品与类型的关系
     * @param baseEntity
     */
    public void deleteBySort(String sort){
        String hql = "DELETE FROM  ProductRefSort s WHERE s.sort="+sort;
        Query query = super.getSession().createQuery(hql);
        query.executeUpdate();
    }
}
